#!/usr/bin/env node

const { EventEmitter } = require('events'),
      log          = console.log,
      e            = new EventEmitter();
      setInterval(() => {
        e.emit('bye');
      }, 1000);
      

setInterval(() => {
  e.emit('hello');
}, 1000);


e.on('hello', () => {
  log('hello world!');
});

e.on('bye', () => {
  log('goodbye!');
  
});